Skip to content

Extract transience calculation logic into reusable helper#36

Merged
Reefact merged 1 commit into
mainfrom
claude/zealous-pascal-605oej
Jul 6, 2026
Merged

Extract transience calculation logic into reusable helper#36
Reefact merged 1 commit into
mainfrom
claude/zealous-pascal-605oej

Conversation

@Reefact

@Reefact Reefact commented Jul 6, 2026

Copy link
Copy Markdown
Owner

Summary

Centralizes the transience resolution logic used by multiple inner-error collections into a dedicated TransienceCalculator helper class. This eliminates code duplication between PrimaryPortInnerErrors and SecondaryPortInnerErrors while maintaining a single authoritative implementation.

Type of change

  • Refactoring

Changes

  • Added TransienceCalculator static helper class with a Compute(IEnumerable<Error>) method that encapsulates the transience resolution rules
  • Updated PrimaryPortInnerErrors.ComputeTransience() to delegate to TransienceCalculator.Compute()
  • Updated SecondaryPortInnerErrors.ComputeTransience() to delegate to TransienceCalculator.Compute()
  • Removed 13 lines of duplicated transience calculation logic from both classes

Testing

  • No new tests required; existing transience calculation behavior is unchanged and covered by existing tests

Documentation

  • No documentation change required

…ator

Both PrimaryPortInnerErrors and SecondaryPortInnerErrors carried a
byte-for-byte identical ComputeTransience implementation. Extract that
logic into an internal TransienceCalculator helper and have both classes
delegate to it, so the transience resolution rules live in a single
authoritative place. Behaviour is unchanged; existing coverage in
PortInnerErrorsTests exercises all branches through the public API.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011eKgk4tXrcECvpepJwGshF
@Reefact Reefact merged commit 507d7d0 into main Jul 6, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants